package com.foreveross.taskservice.core.domain.channel;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.openkoala.koala.commons.domain.KoalaIDEntity;

import com.foreveross.taskservice.common.GlobalsConst;
/**
 * 抓取渠道实体
 * @author xiangsf 
 * @since 2013-1-31
 */
@javax.persistence.Table(name="fdc_source")
@javax.persistence.Entity
public class GradChannelEntity extends  KoalaIDEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6252631713838184377L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="ID")
	private Long id;
	
	@Column(name="SHORT_NAME")
	private String shortName;
	
	@Column(name="CODE")
	private String code;
	
	@Column(name="NAME")
	private String name;
	
	@Column(name="URL")
	private String homepage;
	
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	/**
	 * 任务超时
	 */
	@Column(name="TASK_TIMEOUT")
	private int taskTimeout = 3600000;
	/**
	 * 补偿次数
	 */
	@Column(name="task_compensate_size")
	private int taskCompensateSize = 1;
	/**
	 * 是否抓取状态
	 */
	@Column(name="CRAWL_STATUS")
	private int status = GlobalsConst.DATA_STATUS_NORMAL;
	/**
	 * httpconnect超时设置,毫秒
	 */
	@Column(name="USE_PROXYIP")
	private int useProxyIp = GlobalsConst.DATA_LOGIC_Y;

	
	public Long getId() {
		return id;
	}
	
	public int getTaskCompensateSize() {
		return taskCompensateSize;
	}

	public void setTaskCompensateSize(int taskCompensateSize) {
		this.taskCompensateSize = taskCompensateSize;
	}
	
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getHomepage() {
		return homepage;
	}
	public void setHomepage(String homepage) {
		this.homepage = homepage;
	}

	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	
	public int getUseProxyIp() {
		return useProxyIp;
	}

	public void setUseProxyIp(int useProxyIp) {
		this.useProxyIp = useProxyIp;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public int getTaskTimeout() {
		return taskTimeout;
	}

	public void setTaskTimeout(int taskTimeout) {
		this.taskTimeout = taskTimeout;
	}

	@Override
	public String[] businessKeys() {
		return new String[]{id.toString()};
	}

}
